package com.hsy.raffle.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author hsy
 * @Date 2023/5/8 16:03
 * @Title: R
 * @Package com.hsy.raffle.vo
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class R {
    private Integer code;
    private String msg;
    private Object data;

    public static R ok (Object data) {
        return new R(0,"OK",data);
    }

    public static R ok () {
        return ok(null);
    }

    public static R fail(Object data) {
        return new R(1,"FAIL",data);
    }

    public static R fail() {
        return fail(null);
    }
}
